package com.lqh.studyproject.agentmodel.cglibproxy;

/**
 * @ClassName CglibTest
 * @Description studyproject
 * @Author bgy-lqh
 * @Date 2020/6/22 15:03
 * @Version cglib测试方法
 **/
public class CglibTest {


    public static void main(String[] args) throws InterruptedException{
//        MyInterceptor interceptor = new MyInterceptor();
//        CglibTest cglibTest=(CglibTest) interceptor.getProxy(CglibTest.class);
//        cglibTest.operate1();
//        cglibTest.operate2();

        Thread t=new Thread(()->{
            System.out.println("开始执行");
            try {
               Thread.sleep(2000);
            }catch(InterruptedException e){
               e.printStackTrace();
            }
            System.out.println("执行完毕");
        });
        t.start();
        Thread.sleep(3000);
        System.out.println("尝试第二次执行");
        t.start();
    }



    public void operate1() {
        System.out.println("操作数据库1");
    }

    public void operate2() {
        System.out.println("操作数据库2");
    }
}